This R Markdown document is made to interactively update and view the
DFO region where sightings records occur prior to import in the WSDB
using leaflet
REQUIREMENTS:
- An input file - formatted Excel sheet with two tabs:
- a sighting data sheet prepped with clean coordinate
(LATITUDE/LONGITUDE) and species code (SPECIES_CD) info that will be
used for DFO region assignment and will be checked for “land
whales.”
- a “species codes” tab in the input sheet or separate xlsx in the
input folder with a tab called “species codes.” This defines the list of
species codes and associated species names (This is currently specified
as a separate xlsx in “species” object below)
The name of input files needs to be manually updated in this
Rmarkdown script in the code block below —>
# INPUTS NEED TO BE CSV files, file names are specified in quotations here:
input_file <-"ECSASValidatedEntry2024.csv"
species = "speciesCodes.csv"
#source lat long conversion function
source("scripts/LatLong_convert.R")
- The correct folder structure and file names:
input: folder contains Excel sheet of sighting
coordinates to check land and assign to regions. The name of this file
needs to be specified by editing the rmarkdown file in the code block
above.
output: folder containing .csv files of results:
- FileName-REGIONCODES.csv - The data with regions, land
whales and species code variables populated
- FileName-possible_Dups.csv - The records that may be
possible duplicates based on matching coordinates and Date/Time
stamps
- FileName-NA_COORDS.csv - The records that have NA values or
errors with given coordinate info
- FileName-MULTIPLE_REGIONS.csv - Any records that fall on
the line between regions and have two region assignments (rare, maybe
impossible with current analysis, but just in case!)
If you want an html map file and subfolder of html files for use
outside of R, change save_map to TRUE
save_map = F
Confirm DFO REGION of the points on a map